package com.ccb.jyzx.expand.tiantouonline.controller;

import com.ccb.jyzx.expand.tiantouonline.job.ClassifyJob;
import com.ccb.jyzx.expand.tiantouonline.view.result.Result;
import com.ccb.jyzx.expand.tiantouonline.view.result.ResultUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @projectName: extend
 * @author: jianghaolin
 * @date: 2019/11/22
 * @version: 1.0
 */
@Controller
@RequestMapping("/tto/hand")
@Api(tags = "级联操作相关接口")
public class HandController {

    @Autowired
    private ClassifyJob job;

    @ResponseBody
    @PostMapping(value = "send",consumes = "application/json;charset=UTF-8")
    @ApiOperation(value = "发送", notes = "发送")
    private Result send(){
        job.send();
        return ResultUtil.success();
    }

    @ResponseBody
    @PostMapping(value = "trance",consumes = "application/json;charset=UTF-8")
    @ApiOperation(value = "合并转换", notes = "合并转换")
    private Result trance(){
        job.trance();
        return ResultUtil.success();
    }

    @ResponseBody
    @PostMapping(value = "push",consumes = "application/json;charset=UTF-8")
    @ApiOperation(value = "推送", notes = "推送")
    private Result push(){
        job.push();
        return ResultUtil.success();
    }

    @ResponseBody
    @PostMapping(value = "tgz",consumes = "application/json;charset=UTF-8")
    @ApiOperation(value = "压缩", notes = "压缩")
    private Result tgz(){
        job.getTgz();
        return ResultUtil.success();
    }
}
